<%@ page contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ include file="/common/init.jsp"%>
<script src="<c:url value='/resources/js/jquery-1.7.2.min.js"'/>"></script>
<link href="<c:url value='/admin/css/custom.css" rel="stylesheet'/>" type="text/css" />
<link href="<c:url value='/admin/css/style_new" rel="stylesheet'/>" type="text/css" />
<link href="<c:url value='/admin/css/style.css'/>" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<c:url value='/resources/js/jquery-1.7.2.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/resources/My97DatePicker/WdatePicker.js'/>"></script>
<style type="text/css">
<!--
body {
	background: #ffffff;
	margin-top:10px;
	margin-left:5px;
	margin-right:5px;
}
-->
</style>
<div class="EpmsSubTitle"><p><b>挂牌价格修改</b></p></div>
<form method="post" action="listSaleOrBuy.action" id="stockChangePriceForm">
	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="EpmsTable">
	    <tr>
		    <td class=EpmsTdTitle >会员ID：</td>
		    <td class=EpmsTdNoColor >
		    	<input type="text" name="userid" value="${userid }" style="width:120"/> 
		    </td>
		    <td class=EpmsTdTitle >交易类型：</td>
		    <td class=EpmsTdNoColor >
		    	<select name="tradeType">
		    		<option value="0" <c:if test="${tradeType == '1' }"></c:if>>会员买入（自由交易）</option>
		    		<option value="1" <c:if test="${tradeType == '2' }"></c:if>>会员卖出（自由交易）</option>
		    	</select>
		    </td>
		    <td class=EpmsTdTitle >价格：</td>
		    <td class=EpmsTdNoColor >
		    	<input type="text" name="startprice" style="width:80" value="${startprice }"/> ~
		    	<input type="text" name="endprice" style="width:80" value="${endprice}"/>
		    </td>
	    </tr>
		<tr>
			<td class=EpmsTdTitle >身份证：</td>
		    <td class=EpmsTdNoColor >
		    	<input type="text" name="card" style="width:180" value="${card }"/>
		    </td>
		    <td class=EpmsTdTitle >姓名：</td>
		    <td class=EpmsTdNoColor >
		    	<input type="text" name="name" style="width:80" value="${name }"/>
		    </td>
		    <td class=EpmsTdTitle colspan="2">
		    	<input type="submit" value="点击搜索"/> 
		    </td>
		</tr>
		<tr>
		    <td class=EpmsTdTitle colspan="6">
				指定股票价格： <input type="text" name="price" style="width:80"/>
				<input type="button" value="确认修改" id="stockChangePrice"/> 
		    </td>
		</tr>
	</table>
</form>
<div class="EpmsSubTitle"><p><b>数据列表</b></p>
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="EpmsTable">
  <tr>
	  <td class=EpmsTdTitle>流水号</td>
	  <td class=EpmsTdTitle>用户名</td>
	  <td class=EpmsTdTitle>价格</td>
	  <td class=EpmsTdTitle>挂牌股数</td>
	  
  </tr>
	<c:forEach var="stock" items="${page.result }">
		<tr>
		    <td class=EpmsTdNoColor >${stock.id }</td>
		    <td class=EpmsTdNoColor >${stock.userId }</td>
			<td class=EpmsTdNoColor >${stock.price }</td>
			<td class=EpmsTdNoColor >${stock.stockQuantity }</td>
		</tr>
	</c:forEach>
	<tr>
		<td class="EpmsTdNoColor" colspan="9" align="right">
			<a href="javascript:void(0);" style="text-decoration: none;">
				<span onclick="frontpage(${page.pageNo-1})">上一页</span>&nbsp;
			</a>
			<a href="javascript:void(0);" style="text-decoration: none;">
				<span onclick="nextpage(${page.pageNo+1})">下一页</span> &nbsp;
			</a>
		</td>
	</tr>
</table>
<script>
	//stockSplitForm
	$("#stockChangePrice").click(function(){
		if(window.confirm("确认进行此操作吗？")){
			var form = $("#stockChangePriceForm");
			form.attr("action","saleOrBuy.action");
			form[0].submit();
		}
	});
	
	function frontpage(pageNo){
		var form = $("#stockChangePriceForm");
		form.attr("action","listSaleOrBuy.action?pageNo="+pageNo);
		form[0].submit();
	}

	function nextpage(pageNo){
		var form = $("#stockChangePriceForm");
		form.attr("action","listSaleOrBuy.action?pageNo="+pageNo);
		form[0].submit();
	}
</script>